|
|
|
|
|
|
|
source to the target. It does this by providing the methods needed to store, retrieve, and analyze the data. Table 15.3 lists the property and methods used by the DataObject object. |
|
|
|
|
| TABLE 15.3. THE METHODS AND PROPERTIES OF THEDataObject. | | Category | Item | Description | | Property | Files | Holds the names of files dragged to or from the Windows Explorer. | | Methods | Clear | Clears the content of the DataObject object. | | GetData | Retrieves data from the DataObject object. | | GetFormat | Determines if a specified data format is available in the DataObject object. | | SetData | Places data into the DataObject or sets a specified format. |
|
|
|
|
|
|
These methods enable you to manage the data in the DataObject only for the controls in your application. The three important methods are the GetData, SetData, and GetFormat. The first two give you the ability to put data into the DataObject or to retrieve the data it contains. The last one enables you to check the format of the data before you process it, in case the data isn't valid for the target control (such as text being dropped on a picture box). All three methods use the same constants that are listed in Table 15.4 to test or set the format of the data. |
|
|
|
|
| TABLE 15.4. OLE DRAG AND DROP VISUAL BASIC-SUPPLIED CONSTANTS. | | Constant | Value | Meaning | | vbCFText | 1 | Text | | vbCFBitmap | 2 | Bitmap (.BMP) | | vbCFMetafile | 3 | Metafile (.WMF) | | vbCFEMetafile | 14 | Enhanced metafile (.EMF) | | vbCFDIB | 8 | Device-independent bitmap (.DIB or .BMP) | | vbCFPalette | 9 | Color palette | | vbCFFiles | 15 | List of files | | vbCFRTF | 16639 | Rich text format (.RTF) |
|
|
|